
//fm请求
export const fm=()=>fetch('http://106.12.79.128:666/personal_fm')
        .then(body=>body.json())
        .then(res=>res)

//获取歌曲
// export const getsong=(id)=>fetch(`http://106.12.79.128:666/song/url?id=${id}`)

export const getsong=(id)=>fetch(`http://106.12.79.128:666/song/url?id=${id}`)
        .then(body=>body.json())
        .then(res=>{
                return res
        })

//返回歌单数量
// export const getList=(id)=>fetch(`http://106.12.79.128:666/user/playlist?uid=32953014`)
export const getList=(id)=>fetch(`http://106.12.79.128:666/user/playlist?uid=${id}`)  
        .then(body=>body.json())
        .then(res=>{
                return res
        })

//获取对应歌曲
        // export const musics=(id)=>fetch(`http://106.12.79.128:666/playlist/detail?id=2248240092`)
        export const musics=(id)=>fetch(`http://106.12.79.128:666/playlist/detail?id=${id}`)
        .then(body=>body.json())
        .then(res=>{
                return res.playlist.tracks
        })

//获取歌曲评论 
        export const pinglun=(id)=>fetch(`http://106.12.79.128:666/comment/music?id=${id}&limit=10`)
        .then(body=>body.json())
        .then(res=>{
                return res
        })

//提交评论
        export const submit=(id,content)=>fetch(`http://106.12.79.128:666/comment?t=1&type=0&id=${id}&content=${content}`)
        .then(body=>body.json())
        .then(res=>{
                console.log(res);
        })

//用户电台

        export const getaudio=()=>fetch("http://106.12.79.128:666/dj/hot")
        .then(body=>body.json())
        .then(res=>{
                return res
        })

//获取歌单
        export const getlist=()=>fetch("http://106.12.79.128:666/top/playlist")
                .then(body=>body.json())
                .then(res=>{
                        return res
                })

//播放记录
        export const getnow=(uid)=>fetch(`http://106.12.79.128:666/user/record?uid=${uid}`)
        .then(body=>body.json())
        .then(res=>{
                return res
        })


//歌单详情
        export const getdetail=(id)=>fetch(`http://106.12.79.128:666/playlist/detail?id=${id}`)
        .then(body=>body.json())
        .then(res=>{
                return res
        })